<template>
  <div>
    <!-- 库存 -->
    <p>库存</p>
    <div><stock @addtocar="addtocar" /></div>
    <p>购物车</p>
    <!-- 购物车 -->
    <div><car /></div>
  </div>
</template>

<script setup>
import stock from "./stock.vue";
import car from "./car.vue";
import { ref } from "vue";
let data = ref([{}]);
defineEmits(["addtocar"]);
let addtocar = (ele) => {
  data.value.push(ele);
  console.log("data", data.value);
};
</script>
